package com.zjc.springboot.delayqueue.utils;

public class HashUtils {

    public static int strHash(String key, int mod) {
        return strToInt(key) % mod;
    }

    public static int strToInt(String key) {
        int num = 0;
        for (int i = 0; i < key.length(); i++) {
            char c = key.charAt(i);
            num += c;
        }
        return num;
    }
}
